/*WAP to find transpose of a 4  X 4 matrix*/
#include<stdio.h>
#include<conio.h>
void main()
{
	int arr[4][4];/* = {
						{5, 8, 6, 8},
						{7, 6, 5, 4},
						{1, 2, 3, 7},
						{7, 9, 6, 2}
					};*/
	int i, j;

	clrscr();

	printf("\n\n\t\tEnter 4 X 4 Matrix: ");

	for(i = 0; i <= 3; i++)
	{
		for(j = 0; j <= 3; j++)
		{
			scanf("%d", &arr[i][j]);
		}
	}
	for(i = 0; i <= 3; i++)
	{
		for(j = 0; j <= 3; j++)
		{
			printf("\t%d", arr[i][j]);
		}
		printf("\n\n");
	}
	printf("\n\n\n\n");

	for(i = 0; i <= 3; i++)
	{
		for(j = 0; j <= 3; j++)
		{
			printf("\t%d", arr[j][i]);/*i = column, j = row, for transposing
									  just change rows into column & column
									  into rows*/
		}
		printf("\n\n");
	}
	printf("\n\n");

	getch();
}